
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

 <meta charset="UTF-8" http-equiv="Content-Type" content="text/html; charset=utf-8" />

 <title>测试上报</title>


</head>



<body>



<script type="text/javascript">
    (function () {
        var win = window,
            doc = document;
        var lm_id=GetQueryString("lm_id");
        var site_id="";
        var cookie={
            addCookie:function (objName,objValue,objDays) {
                var str = objName + "=" + escape(objValue);
                if(objDays > 0){
                    var date = new Date();
                    var ms = objDays*24*3600*1000;
                    date.setTime(date.getTime() + ms);
                    str += "; expires=" + date.toGMTString();
                }
                if(objDays===Infinity){
                    str += "; expires=Fri, 31 Dec 9999 23:59:59 GMT";
                }
                str += "; path=/";
                doc.cookie = str;
            },
            get:function (name) {
                var cname=name+'=';
                var arrCookie=doc.cookie.split(';');
                for(var i=0;i<arrCookie.length;i++){
                    var cookie=arrCookie[i];
                    while(cookie.charAt(0) == ' ') cookie=cookie.substring(1);
                    if(cookie.indexOf(name) != -1) return cookie.substring(cname.length,cookie.length);
                }
                return '';
            }
        };
        var arandDiv=Math.floor(Math.random()*1000000);
        document.write('<div id="'+arandDiv+'" style="width: 0.001px;height: 0.001px;margin: 0;padding: 0;opacity: 0"></div>');
        function isShow() {
            var itop = document.getElementById(arandDiv).getBoundingClientRect().top;
            var ise = document.documentElement.clientHeight;
            if(itop <= ise && itop > 0) {
                return 'true';
            }else {
                return 'false';
            }
        }
        function url() {
            return encodeURIComponent(win.location.href);
        }
        function getScreenResolution() {
            return win.screen.width + "*" + win.screen.height;
        }
        function GPU() {
            var canvas = doc.createElement('canvas'),
                gl = canvas.getContext('experimental-webgl'),
                debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
            return gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
        }
        function title() {
            return doc.title;
        }
        function uuid() {
            var s = [];
            var hexDigits = "0123456789abcdef";
            for (var i = 0; i < 36; i++) {
                s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
            }
            s[14] = "4";
            s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
            s[8] = s[13] = s[18] = s[23] = "";

            var uuid = s.join("");
            return uuid;
        }
        var uuid=uuid();
        if(!cookie.get('UUID_XB')){
            cookie.addCookie('UUID_XB',uuid,Infinity);
        }
        function searchInformation() {
            var referrer,
                searchInformation;
            try {
                referrer = win.opener ? win.opener.doc.location.href : doc.referrer;
            } catch (e) {
                referrer = doc.referrer;
            }
            function content(r) {
                var s = ["wd", "p", "q", "keyword", "kw", "w", "key", "word", "query", "q1", "name"];
                if (r != "" && r != null) {
                    for (var i = 0; i < s.length; i++) {
                        var re = new RegExp("[^1-9a-zA-Z]" + s[i] + "=\([^&]*\)");
                        var kk = r.match(re);
                        if (kk != null) {
                            return kk[1];
                        }
                    }
                }
                return "";
            }
            function engine(r) {
                var regexp=/\.(sogou|soso|baidu|google|youdao|yahoo|bing|118114|biso|gougou|ifeng|ivc|sooule|niuhu|biso)(\.[a-z0-9\-]+){1,2}\//ig;
                if (r != "" && r != null) {
                    return r.match(regexp);
                }
                return "";
            }
            searchInformation = referrer ? {
                referrer: encodeURIComponent(referrer),
                content: encodeURIComponent(content(referrer)),
                engine: encodeURIComponent(engine(referrer))
            } : {
                referrer: encodeURIComponent(referrer)
            };
            return searchInformation;
        }
        function isWeiXin(){
            var ua = window.navigator.userAgent.toLowerCase();
            if(ua.match(/MicroMessenger/i) == 'micromessenger'){
                return 'MicroMessenger';
            }else{
                return false;
            }
        }
        var userAgent = window.navigator.userAgent;
        var isShow=isShow(),
            url=url(),
            screen=getScreenResolution(),
            GPU=GPU(),
            title=title(),
            isWeiXin=isWeiXin(),
            searchInformation=searchInformation();
        function __imgGet() {
            var __imgXb = new Image();
            __imgXb.src="http://data1.xinba.com/log/newData?lm_id="+lm_id+"&site_id="+site_id+"&userAgent="+userAgent+"&referrer="+searchInformation.referrer+"&url="+url+"&screen="+screen+"&gpu="+GPU+"&title="+title+"&content="+searchInformation.content+"&engine="+searchInformation.engine+"&uuid="+cookie.get('UUID_XB')+"&isShow="+isShow;
        }
        __imgGet();
    })();


    function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);//search,查询？后面的参数，并匹配正则
        if(r!=null)return  unescape(r[2]); return null;
    }


</script>

<!--<script src="http://data1.xinba.com/data/getCode/789654/090909"></script>-->


</body>

</html>
